import request from '@/utils/request'
import myRequest from '@/utils/myRequest'
// import qs from 'qs'

/**
 * 薪资管理-月薪明细-获取列表
 * url:'/hr/salaryMonth/pay/list'
 * method:GET
 * @Header Authorization: 登录接口返回的token
 * @Query params:{
    page: 1, // 当前页数
    size: 20, // 每页个数
    sort: '', // 排序
    deptId: '', // 部门
    salaryMonth: '' // 发放月份
 * }
 * @returns {*}
 */
export const getSalarylistListAPI = (params = {}) => {
  return request.get('/hr/salaryMonth/pay/list', {
    params
  })
}

/**
 * 薪资管理-月薪明细-导出
 * url:'/hr/salaryMonth/pay/export'
 * method:POST
 * @Header Authorization: 登录接口返回的token
 * @Query params:{}
 * @returns {*}
 */
export const exportSalarylistListAPI = (params = {}) => {
  return myRequest({
    method: 'get',
    url: `/hr/salaryMonth/pay/export`,
    responseType: 'blob',
    params
  })
}

export const exportSalarylistListAPI2 = (params = {}) => {
  return myRequest({
    method: 'get',
    url: `/hr/salaryMonth/pay/exportShare`,
    responseType: 'blob',
    params
  })
}

/**
 * 薪资管理-月薪明细历史-获取列表
 * url:'/hr/salaryMonth/pay/list'
 * method:GET
 * @Header Authorization: 登录接口返回的token
 * @Query params:{
    page: 1, // 当前页数
    size: 20, // 每页个数
    sort: '', // 排序
    deptId: '', // 部门
    salaryMonth: '' // 发放月份
 * }
 * @returns {*}
 */
export const getSalaryMonthListAPI = (params = {}) => {
  return request.get('/hr/employee/salaryMonth', {
    params
  })
}

/**
 * 薪资管理-月薪明细历史-导出
 * url:'/hr/salaryMonth/pay/export'
 * method:POST
 * @Header Authorization: 登录接口返回的token
 * @Query params:{}
 * @returns {*}
 */
export const exportSalaryMonthListAPI = (params = {}) => {
  return myRequest({
    method: 'get',
    url: `/hr/employee/salaryMonth/export`,
    responseType: 'blob',
    params
  })
}
